package com.favccxx.marketplace.order.api;

//@RestController
public class OrderController {

    /*@Autowired
    OrderService orderService;


    @PostMapping("/placeOrder")
    public String placeOrder(@RequestParam(value = "username", required = true) String username,
                             @RequestParam(value = "addressId", required = true) String addressId,
                             @RequestParam(value = "carts", required = true) String carts) {
        try {
            ObjectMapper objectMapper = new ObjectMapper();
            CartDTO[] cartArr = objectMapper.readValue(carts, CartDTO[].class);
            List<CartDTO> cartList = Arrays.asList(cartArr);

            OrderDTO orderDTO = new OrderDTO();
            orderDTO.setAddressId(addressId);
            orderDTO.setUsername(username);
            orderDTO.setCartList(cartList);


            return orderService.placeOrder(orderDTO);

        } catch (Exception e) {
            e.printStackTrace();
        }


        return "error";


    }*/
}
